//
//  SmallMoto.cpp
//  HelloCpp
//
//  Created by Nguyen Cong Huy on 10/25/14.
//
//

#include "SmallMoto.h"

float SmallMoto::width = 0.7*METTER_TO_POINT;
float SmallMoto::length = 1.7*METTER_TO_POINT;

SmallMoto::SmallMoto()
{
    setTag(ID_BIG_MOTO);
}

SmallMoto::~SmallMoto()
{
}

bool SmallMoto::init(){
    Vehicle::init();
    
    mainSprite = CCSprite::createWithSpriteFrameName("Moto.png");
    mainSprite->setAnchorPoint(ccp(0, 0));
    addChild(mainSprite);
    
    float realSizeX = length;
    float scaleFactorX = realSizeX/mainSprite->boundingBox().size.width;
    mainSprite->setScaleX(scaleFactorX);
    
    float realSizeY = width;
    float scaleFactorY = realSizeY/mainSprite->boundingBox().size.height;
    mainSprite->setScaleY(scaleFactorY);
    
    setContentSize(mainSprite->boundingBox().size);
    
    return true;
}